import request from '@/api/request.js'
import requestBlob from '@/api/requestBlob'


const api_name = 'RolesURL'

export default {
  //查询角色
  selectList(Data) {
    return request({
      url: `${api_name}/selectList`,
      method: 'post',
      data: Data
    })
  },
  //插入角色
  insert(Data) {
    return request({
      url: `${api_name}/insert`,
      method: 'post',
      data: Data
    })
  },

  //删除角色
  deleteByRoleId(roleId) {
    return request({
      url: `${api_name}/deleteByRoleId/${roleId}`,
      method: 'get',
    })
  },

  //修改角色
  updateByRoleId(Data) {
    return request({
      url: `${api_name}/updateByRoleId`,
      method: 'post',
      data: Data
    })
  },
  //根据id查询角色
	selectByRoleId(roleId){
		return request({
			url: `/${api_name}/selectByRoleId/${roleId}`,
			method: 'get',
		})
	},
  //导出角色到Excel
  ExportExcel(pageNum,pageSize,roleId,roleNameLike) {
    return requestBlob({
      url: `${api_name}/ExportExcel/${pageNum}/${pageSize}/${roleId}/${roleNameLike}`,
      method: 'get',
    })
  },
}